<%@ page contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/runqianReport4.tld" prefix="report" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.runqian.report4.usermodel.Context"%>
<%@ page import="com.kh.pajx.sop.util.sop.PropertyValidate" %>
<%
             String path=request.getContextPath();

%>

<html>
<head>
<title>报表统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <style>
.report1 { display:none}
  </style>
</head>
<script type="text/javascript">
  
    /* function del(){
    	$(".report1").remove();
    } */
</script>
<body topmargin=0 leftmargin=0 rightmargin=0 bottomMargin=0 onload="del();">

<%
	System.out.println("------------------------");
	request.setCharacterEncoding( "utf-8" );
	System.out.println("xxoo: "+request.getParameter("xxoo"));
	String report = request.getParameter( "raq" );
	System.out.println("report: "+report);
	String reportFileHome=Context.getInitCtx().getMainDir();
	System.out.println(reportFileHome);
	StringBuffer param=new StringBuffer();

	//session.setAttribute("user_id","111111");

	//保证报表名称的完整性
	int iTmp = 0;
	if( (iTmp = report.lastIndexOf(".raq")) <= 0 ){
		report = report + ".raq";
		iTmp = 0;
	}
	
	Enumeration paramNames = request.getParameterNames();
	if(paramNames!=null){
		while(paramNames.hasMoreElements()){
			String paramName = (String) paramNames.nextElement();
			String paramValue= request.getParameter(paramName);
			//paramValue = PropertyValidate.validateKYReportInput(paramName, paramValue)
			if(paramValue!=null){
				//把参数拼成name=value;name2=value2;.....的形式
				param.append(paramName).append("=").append(paramValue).append(";");
			}
		}
	}

	//以下代码是检测这个报表是否有相应的参数模板
	String paramFile = report.substring(0,iTmp)+"_arg.raq";
	File f=new File(application.getRealPath(reportFileHome+ File.separator +paramFile));

%>
				<jsp:include page="toolbar.jsp" flush="false" />
				<table id=rpt align=center><tr><td>
				<%	//如果参数模板存在，则显示参数模板
					if( f.exists() ) {
					%>
					<table id=param_tbl><tr><td>
						<report:param name="form1" paramFileName="<%=paramFile%>"
							needSubmit="no"
							params="<%=param.toString()%>"
							
						/>
					</td>
					<td><a href="javascript:_submit( form1 )"><img src="${pageContext.request.contextPath}/style/report/query.jpg" border=no style="vertical-align:middle"></a></td>
					</tr></table>
					<% }
				%>
				
				<table align=center>
					<tr><td>
						<report:html name="report1" reportFileName="<%=report%>"
							funcBarLocation=""
							needPageMark="yes"
							generateParamForm="no"
							needLinkStyle="yes"
							params="<%=param.toString()%>"
							width="-1"
							exceptionPage="/report/reportJsp/myError2.jsp"
						/>
					</td></tr>
				</table>
	
				<script language="javascript">
					//设置分页显示值
					document.getElementById( "t_page_span" ).innerHTML=report1_getTotalPage();
					document.getElementById( "c_page_span" ).innerHTML=report1_getCurrPage();
					function show_detail(orderId){
						window.open("showReport.jsp?raq=order_detail.raq&orderid="+orderId,"_blank");
					}
				</script>
				 <!-- <script language="javascript">
					//给C2单元格定义onClick事件
					document.getElementById("report1_C2").onclick=function()
					{
						//用document中提供的方法取B2单元格的显示值
						var  a=document.getElementById("report1_B2").innerText;
						alert("value="+a);
						//定义页面跳转的url，并且把参数和参数值添加到url中
						window.location="showReport.jsp?raq=new1.raq&dingdan="+a;
					}
				</script> -->
</body>
</html>
